const fs = require('fs');

const { generateUsers, generatePosts, generateComments } = require('./fakerFunctions.js')

// 生成数据
const db = {
  users: generateUsers(3),
  posts: generatePosts(5, 2),
  comments: generateComments(10, 3, 5),
};

// 写入数据
fs.writeFileSync('db.json', JSON.stringify(db, null, 2));
console.log('db.json file created successfully.');
